import { getCurrentInstance } from 'vue'

export default function useUniPopup(name){
  const { ctx } = getCurrentInstance()

  const openModal = (name)=>{
    ctx.$refs[name].open()
  }
  const closeModal = (name)=>{
    ctx.$refs[name].close()
  }

  return {
    openModal,
    closeModal
  }
}
